package org.ipower.examsystem.action;

import java.util.ArrayList;
import java.util.List;
import org.ipower.examsystem.domain.CooperationMember;
import org.ipower.examsystem.service.CooperationMemberService;
import org.ipower.platform.domain.Pager;
import org.ipower.platform.domain.QueryCondition;

/**
 * 获取合作机构成员数据。
 * @author jeasonyoung
 **/
public class CooperationMemberAction extends ModuleBaseAction<CooperationMemberService> {
    private static final long serialVersionUID = 1L;
    private Pager<CooperationMember>  dataSource = new Pager<CooperationMember>();
    private String cooperationID;
    /**
     * 设置合作机构ID。
     * @param cooperationID 合作机构ID。
     * */
    public void setCooperationID(String cooperationID) {
        this.cooperationID = cooperationID;
    }
    /**
     * 获取分页数据。
     * @return 分页数据。
     * */
    public Pager<CooperationMember> getDataSource() {
        return dataSource;
    }
    /**
     * 获取列表数据。
     * @return 执行结果。
     * */
    public String list(){
        List<QueryCondition> entities = new  ArrayList<QueryCondition>();
        if(this.cooperationID != null && !this.cooperationID.isEmpty()){
            entities.add(new QueryCondition("CooperationID", this.cooperationID));
        }
        this.dataSource = this.getService().findAll(this.getAscProperty(), this.isAsc(), this.getStart(), this.getLimit(), entities);
        return SUCCESS;
    }
    /**
     * 默认执行。
     * @return 执行结果。
     * */
    @Override
    public String execute() throws Exception{       
        return SUCCESS;
    }
}